home *** CD-ROM | disk | FTP | other *** search
- Path: news.central.ntua.gr!not-for-mail
- From: hnick@central.ntua.gr (halidias nikos)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: kbhit
- Date: 29 Feb 1996 02:47:18 GMT
- Organization: National Technical University of Athens, Greece
- Message-ID: <4h343m$q7n@zeus.central.ntua.gr>
- References: <dkauppDnGztK.Ex@netcom.com>
- NNTP-Posting-Host: gate2-zeus.central.ntua.gr
- X-Newsreader: NN version 6.5.0 #1 (NOV)
-
- Hiya Dave,
- The trick to 'kbhit' under AmigaDOS is to set the console on RAW mode when
- it defaults to COOKED mode.
- What you asked however "without opening any libraries..." it would need
- to hit the hardware in order to check the keys. But I take it you didn't
- actually meant "dos.library" in there, since C startup code usually opens
- it.
- Ok, my way requires AmigaOS 2.0. What you do is:
- SetMode(Input(),1); /* This gets your console in raw mode */
- from now on, FGetC(Input()) returns the character your pressed imediately
- with no buffering at all.
- And when you are done with it do:
- SetMode(Input(),0); /* Console back on cooked mode */
- This is it, I hope this does what you need. If you need this staff in a
- working C function, mail me and I'll send you one.
- Cheers,
- Alex
-
- --
-
- +----------------------------------------------------------------------------+
- | Alkinoos Alexandros Argiropoulos A1200, '030@40, 6MB Fast |
- | Athens, Greece "AAA is not a chipset...It's my name" |
- +----------------------------------------------------------------------------+
-